<%@page import="java.security.MessageDigest"%>
<%@page import="com.kflow.interfaces.sms.SmsImpl"%>
<%@page import="com.kflow.interfaces.Message"%>
<%@page import="com.kflow.util.WebConfig"%>
<%@ page  pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%!
public String encrypt(String inStr,String salt) throws Exception 
{
	if (inStr==null) {return "";}
	if (salt==null) {salt="";}
    MessageDigest md5 = null;
    try 
    {
        md5 = MessageDigest.getInstance("MD5");
        byte[] byteArray = (inStr+salt).getBytes("UTF-8");
        byte[] md5Bytes = md5.digest(byteArray);
        StringBuffer hexValue = new StringBuffer();
        for (int i = 0; i < md5Bytes.length; i++) {
            int val = ((int) md5Bytes[i]) & 0xff;
            if (val < 16) {
                hexValue.append("0");
            }
            hexValue.append(Integer.toHexString(val));
        }
        return hexValue.toString();
    } catch (Exception e) 
    {
        e.printStackTrace();
       throw e;
    }
   
}
%>
<%

String address=WebConfig.getProperty("sms.address");
String userId=WebConfig.getProperty("sms.userid");
String password=WebConfig.getProperty("sms.password");
out.println("<br/>address="+address);
out.println("<br/>userId="+userId);
out.println("<br/>password="+password);
password=encrypt(password,"");
out.println("<br/>password="+password);

SmsImpl sms = new SmsImpl("18680723212","短信测试");
sms.setPassword(password);
boolean flag = sms.send();
System.out.println("<br/>flag="+flag);

%>
</body>
</html>